{% extends 'table_base.html' %}

{% block htmltitle %}会议室使用申请{% endblock %}

{% block htmlhead %}
    {% load html_tools %}

    {{ 'meeting_room/table.css' | as_css }}

    {{ 'artDialog/v4/artDialog.js'    | as_js  }}
    {{ 'artDialog/v4/skins/opera.css' | as_css }}
    {{ 'artDialog/popupBox.css'       | as_css }}

    {{ 'popupBox.js'  | as_js  }}
{% endblock %}

{% block top_title %}<h1>会议室使用申请</h1>{% endblock %}
{% block title %}会议室安排表(图形版){% endblock %}

{% block main_content %}

{% for place, apps_every_place in table.content %}
<table class="app_table">
    <tr>
        <td colspan="2"></td>
        {% for time in table.time_list %}
        <td>{{ time }}</td>
        {% endfor %}
    </tr>
    {% for app_every_day in apps_every_place %}      
    {% cycle table.date.0 table.date.1 table.date.2 table.date.3 table.date.4 table.date.5 table.date.6 as date silent %}   
    <tr>
        {% if forloop.first %}
        <td rowspan="7">{{ place }}</td>
        {% endif %}
        <td>{{ date | date:"n月d日" }}</td>
        {% for app in app_every_day %}
            {% if app %}
            <td class="{% if app.approved %}red{%else%}gray{%endif%}" data-app-id="{{ app.id }}" onclick="javascript:showAppForm( this.getAttribute('data-app-id'), 'meeting_room')"></td>
            {% else %}
            <td></td>
            {% endif %}
        {% endfor %}
    </tr>
    {% endfor %}
</table>
{% endfor %}

{% endblock %}
